package com.twinkle.bank;

/**
 * 账户父类
 */
public abstract class Account {

    protected String cardNo;      //卡号
    protected String password;    //密码
    protected int balance;        //余额

    public Account() {
        super();
    }

    public Account(String cardNo, String password, int balance) {
        super();
        this.cardNo = cardNo;
        this.password = password;
        this.balance = balance;
    }

    /**
     * 存款方法
     *
     * @param money 存款金额
     */
    public void save(int money) {
        balance += money;
    }

    /**
     * Abstract Function
     * <p>
     * 取款方法
     *
     * @param money 取款金额
     */
    public abstract void withdraw(int money);

    public String getCardNo() {
        return cardNo;
    }

    public void setCardNo(String cardNo) {
        this.cardNo = cardNo;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public int getBalance() {
        return balance;
    }

    public void setBalance(int balance) {
        this.balance = balance;
    }

}